Notify properties on deletion in PasswordEntryBuffer
authorEmmanuele Bassi <ebassi@gnome.org>
Thu, 17 Dec 2020 15:01:35 +0000 (15:01 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Thu, 17 Dec 2020 15:01:35 +0000 (15:01 +0000)
The GtkEntryBufferClass.deleted_text() behaviour changed between GTK3
and GTK4, which means any subclass of GtkEntryBuffer is now responsible
for emitting the "notify" signal for the "text" and "length" properties.

Without this, the GtkText delegate widget used by GtkPasswordEntry would
not be able to communicate changes in the contents of its buffer.

Fixes: #3484
gtk/gtkpasswordentrybuffer.c

index 2c97417f26fb594348816de782fb95e638da5259..bc9cc0daa927465d964e319f4139f28118768c45 100644 (file)
@@ -135,6 +135,9 @@ gtk_password_entry_buffer_real_deleted_text (GtkEntryBuffer *buffer,
   memmove (self->text + start, self->text + end, self->text_bytes + 1 - end);
   self->text_chars -= n_chars;
   self->text_bytes -= (end - start);
+
+  g_object_notify (G_OBJECT (buffer), "text");
+  g_object_notify (G_OBJECT (buffer), "length");
 }
 
 static guint